<%--
  Created by IntelliJ IDEA.
  User: wyyusong
  Date: 14-7-16
  Time: 下午3:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!--form id="pagerForm" action="/manage/wallet/pluginInfo/updateSequence" method="post"
        onsubmit="return validateCallback(this , dialogAjaxDone);"-->
    <form action="/manage/wallet/pluginCard/updateSequence" method="post" modelAttribute="updateSequence" onsubmit="return validateCallback(this , dialogAjaxDone);">
    <!--onsubmit="return validateCallback(this , dialogAjaxDone);" -->
    <input name="clientName" type="hidden" value="${clientName}"/>
    <c:if test="${not empty belongingType}" >
        <input name="belongingType" type="hidden" value="${belongingType}"/>
    </c:if>
    <div class="j-resizeGrid" style="overflow: auto;">
        <div class="pageContent gridTbody">
            <table class="table" width="100%" layoutH="100">
                <thead>
                <tr>
                    <th style="width:200px">归属类型</th>
                    <th style="width:200px">顺序</th>
                    <th style="width:200px">应用类型</th>
                    <th style="width:200px">描述</th>
                    <th style="width:200px">窗体标题</th>
                    <th style="width:4%">窗体内容</th>
                    <th style="width:4%">窗体内容编码ID</th>
                    <th style="width:200px">客户端类型</th>
                    <th style="width:200px">最低支持版本</th>
                    <th style="width:150px">操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${onlineList}" var="entity" varStatus="status">
                    <tr>
                        <!--利用id传到后台的顺序排序 -->
                        <input type="hidden" name="id" value="${entity.id}"/>
                        <td>
                            <div style="color:${entity.belongingType.fontColor};">${entity.belongingType.description}</div>
                        </td>
                        <td>${entity.sequence}</td>
                        <td><div style="color:${entity.module.fontColor};">${entity.module.moduleName}</div></td>
                        <td>${entity.description}</td>
                        <td>${entity.title}</td>
                        <td>${entity.content}</td>
                        <td>${entity.valueId}</td>
                        <td>${entity.clientName}</td>
                        <td>${entity.clientVersion}</td>

                        <td style="width:150px">
                            <a href="javascript:void(0)" onclick="moveUp(this)" class="j-num hover hoverBold">［上移］</a>
                            &nbsp;
                            <a href="javascript:void(0)"  onclick="moveDown(this)" class="j-num hover">［下移］</a>

                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
    <div class="searchBar">
        <div class="subBar">
                <span class="icon" align="right"><span align="right" id="timerState"
                                                       style="color:#B8860B;">在线总数: ${onLineTotal}</span></span>
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit" id="tijiao">提交</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">关闭</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</form>
<script type="text/javascript">

    $(document).ready(function(){
        /** 关闭选择归属类型对话框 */
        if($("body").data("select_belongingType")){
            $.pdialog.close("select_belongingType");
        }
    });

    //整行上移  TODO 需建立专门的js文件
    function moveUp(arg) {
        var $tr = $(arg).parent().parent().parent();
        var $prevTr = $tr.prev();
        $tr.insertBefore($prevTr);
    }
    //整行下移
    function moveDown(arg) {
        var $tr = $(arg).parent().parent().parent();
        var $nextTr = $tr.next();
        $tr.insertAfter($nextTr);
    }
</script>